let express = require('express');
let app = express();
let locationMovies = require('../mock/LocationMovies.json');
let ad = require('../mock/ad.json');
let GetFirstPageAdvAndNews = require('../mock/GetFirstPageAdvAndNews.json');
let cityList = require('../mock/cityList.json');
let findNewsList = require('../mock/findNewsList.json');

function before(app){
	//首页电影正在热映接口
	app.get("/api/locationMovies",(req,res)=>{
		res.json({
			errno: 0,
			data: locationMovies
		})
	})
	//首页广告
	app.get("/api/ad",(req,res)=>{
		res.json({
			errno: 0,
			data: ad
		})
	})
	//首页今日热点和新闻
	app.get("/api/GetFirstPageAdvAndNews",(req,res)=>{
		res.json({
			errno: 0,
			data: GetFirstPageAdvAndNews
		})
	})
	//城市选择
	app.get("/api/cityList",(req,res)=>{
		res.json({
			errno: 0,
			data: cityList
		})
	})
	//购票页面
	app.get("/api/buyTicket",(req,res)=>{
		res.json({
			errno: 0,
			data: buyTicket
		})
	})
	//发现新闻
	app.get("/api/findNewsList",(req,res)=>{
		res.json({
			errno: 0,
			data: findNewsList
		})
	})
}

module.exports = before;